<%@ page language="java" contentType="text/html; charset=UTF-8"     pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Insert title here</title>
	<link rel="stylesheet" type="text/css" href="css/user_css.css">
	<script type="text/javascript">
	function mileageSearchFormCheck(){
		 var startMileage = document.mileage_search_form.startMileage;
		 var endMileage = document.mileage_search_form.endMileage;
		 
		 if(startMileage.value==""){
			  alert("시작 마일리지를 입력해 주세요.");
			  startMileage.focus();
			  return false;
		 }
		 if(endMileage.value==""){
			  alert("끝마일리지를 입력해 주세요.");
			  endMileage.focus();
			  return false;
		 }
		 if(parseInt(startMileage.value)>parseInt(endMileage.value)){
			  alert("시작마일리지가 끝마일리지보다 작아야 합니다. 다시 입력해 주세요.");
			  startMileage.focus();
			  return false;
		  
		 }
		 if(isNaN(startMileage.value)||isNaN(endMileage.value)){
			  alert("마일리지는 숫자를 입력하십시오.");
			  return false;
		 }
		 
 	}
		
	function nameSearchFormCheck(){
		 var name = document.name_search_form.name;
		 if(name.value==""){
			  alert("이름를 입력해 주세요.");
			  name.focus();
			  return false;
		 }
	}
	</script>
</head>
<body>
<div id="wrap">
	<div id="header">
	    <jsp:include page="/menu.jsp"></jsp:include>
	</div>
	
	<div id="centerCon">
	<br><br><br><br>
	<center>
	<fieldset>
	  	<legend>이름으로 검색하기</legend>
		   <font size="2" color="red">${requestScope.error_message }</font><br>
				
		   <table border="0" style="width:200px;"> 
		       <%--  <form action="/${initParam.context_root }/searchMemberByMileageRange.do" method="post" name="mileage_search_form" onsubmit="return mileageSearchFormCheck()"> 
			    <tr>  
			         <td align="center" bgcolor="#CCCCCC"  style="width:50px;"> 범위 </td>
			         <td> <input type="text" style="width:60px;" name="startMileage"> 
			          ~ 
			         <input type="text" style="width:60px;" name="endMileage">    
		 	         <td> <input type="submit" value="검색">        </td>
		 	    </tr>      
		       </form> --%>
		
		       <form action="/${initParam.context_root }/searchMemberByName.do" method="post" name="name_search_form" onsubmit="return nameSearchFormCheck()">
		       <tr>
		            <td  align="center" bgcolor="#CCCCCC" style="width:50px;"> 이름 </td>
		            <td> <input type="text" style="width:80px;"  name="name"> </td>
		            <td  align="center"> <input type="submit" value="검색"> </td>
		       </tr>  
		       <tr>
		          <td colspan="3">&nbsp;&nbsp;</td>
		       </tr>
		       </form>   
		   </table>
	</fieldset>
	</center>
	</div>
	
	<div id="footer">
		<jsp:include page="/footer.jsp"></jsp:include>   
	</div>
</div>
	
</body>
</html>
